import request from '@/utils/request'

// 查询用户列表
export function listUser(query) {
  return request({
    url: '/system/zy/user/list',
    method: 'get',
    params: query
  })
}
export function listblacklist(query) {
  return request({
    url: '/system/zy/user/add/blacklist',
    method: 'get',
    params: query
  })
}
// 查询用户详细
export function getUser(id) {
  return request({
    url: '/system/zy/user/' + id,
    method: 'get'
  })
}

// 新增用户
export function addUser(data) {
  return request({
    url: '/system/user',
    method: 'post',
    data: data
  })
}

// 修改用户
export function updateUser(data) {
  return request({
    url: '/system/zy/user',
    method: 'put',
    data: data
  })
}

// 删除用户
export function delUser(id) {
  return request({
    url: '/system/zy/user/' + id,
    method: 'delete'
  })
}

//赠送优惠券
export function giveUserCoupon(data) {
  return request({
    url: '/system/userCoupon/giveUserCoupon',
    method: 'post',
    data: data
  })
}